package com.letfox.test.example;

import java.util.HashMap;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import com.letfox.finance.dao.ad.FIMFinADServingDao;
import com.letfox.finance.dao.user.FinAccountRlUAccountDao;
import com.letfox.finance.model.ad.FIMFinADServing;
import com.letfox.finance.model.user.FinAccountRlUAccount;
import com.letfox.test.util.MyBatisUtil;

/**
 * 单元测试
 */
public class FIMExample {

	/**
	 * 需要单元测试的时候在取消注释
	 */
	private FIMFinADServingDao fimFinADServingDao;
	
	private FinAccountRlUAccountDao finAccountRlUAccountDao;
	
	@Test
	public void selectAdFim(){
		SqlSession session = MyBatisUtil.getSqlSession(true);
		try {
			Map<String, String> map=new HashMap<String, String>();
			map.put("planId", "51d9bc12-2ee0-4e34-8c73-31c23622132b");
			map.put("startCreateTime", "2018-03-29 10:48:18");
			map.put("endCreateTime", "2018-03-29 13:30:30");
			fimFinADServingDao = session.getMapper(FIMFinADServingDao.class);
			FIMFinADServing fimFinADServing=fimFinADServingDao.selectADFin(map);
			System.err.println(fimFinADServing.toString());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	
	@Test
	public void selectUserFim(){
		SqlSession session = MyBatisUtil.getSqlSession(true);
		try {
			String accountId="jes";
			finAccountRlUAccountDao = session.getMapper(FinAccountRlUAccountDao.class);
			FinAccountRlUAccount fimFinADServing=finAccountRlUAccountDao.selectByAccountId(accountId);
			System.err.println(fimFinADServing.toString());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

